﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Shared/default.master" AutoEventWireup="true" CodeFile="MyOrderList.aspx.cs" Inherits="Pages_Usercenter_MyOrderList" %>

<%@ Register src="../../Misc/Control/MyAccount.ascx" tagname="MyAccount" tagprefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<title>我的订单</title>
<script type="text/javascript" src="../../JS/jquery.js"></script>
<script type="text/javascript">
    function delete6order(oid, status) {
        $.post("/shared/TuanService.asmx/DeleteOrder", { orderid: oid }, function(data) {
	            if (data) {
	                alert("删除订单成功");
	                setTimeout('myrefresh()', 1000); //指定2秒后刷新
	            } else {
	                alert("删除订单失败，订单状态已改变");
	            }
	        });
          
	    }
function myrefresh()
{
       window.location.reload();
}
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div class="main2"> 
 <div class="main_l">              
  	<!--左侧部分 开始-->
<SCRIPT LANGUAGE="JavaScript">
  <!--
    function go_order(oid) {
        window.location.href = "/pages/buy/orderon.aspx?oid=" + oid;
    }

  //-->
</SCRIPT>	
<div class="dingd_top">
    <asp:ObjectDataSource ID="odsOrderlist" runat="server" 
        OldValuesParameterFormatString="original_{0}" SelectMethod="GetModelListByEmail" 
        TypeName="Tuan.BLL.OrderInfo">
        <SelectParameters>
            <asp:ControlParameter ControlID="hdUserName" DefaultValue="" Name="email" 
                PropertyName="Value" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
			<ul>
				<li><a href="MyOrderList.aspx"><span>我的订单</span></a></li>
				<li class="navon"><a href="MyEventList.aspx"><span>我的活动</span></a></li>
				<li class="navon"><a href="MyAddressList.aspx"><span>地址簿</span></a></li>
				<li class="navon"><a href="MyReviewList.aspx"><span>我的留言</span></a></li>
			</ul>
		</div>
		<div class="l_area3">	
			<div class="dingd">
				<ul>
					<li class="dingd_1 fb">产品</li>
					<li class="dingd_2 fb">单价</li>
					<li class="dingd_3 fb">数量</li>
					<li class="dingd_4 fb">运费</li>
					<li class="dingd_5 fb">总价</li>
					<li class="dingd_6 fb">M币支付</li>
					<li class="dingd_7 fb">订单状态</li>
					<li class="dingd_8 fb">操作</li>
				</ul>
				<pan:SmartGridView ID="panGdvOrderList" runat="server"  BorderWidth=0
                AutoGenerateColumns="False" DataSourceID="odsOrderList" AllowPaging="True"  PageSize="10"  >
                <Columns>
                <asp:TemplateField>
                <ItemTemplate>
				<ul class="dingd_gray">
					<li class="dingd_1_t"><a href='/pages/index.aspx?pid=<%#Eval("ProductID") %>' target="_blank"><%# Eval("ProductName") %></a></li>
					<li class="dingd_2"><%#Eval("Price")  %></li>
					<li class="dingd_3"><%#Eval("Count") %></li>
					<li class="dingd_4"><%#Eval("Freight") %></li>
					<li class="dingd_5"><%#Eval("TotalAmount") %></li>
					<li class="dingd_6"><%#Eval("Token") %></li>
					<li class="dingd_7">  <%# (Eval("Status").ToString()=="1"?"等待支付":"已经支付") %></li>
					<script type="text/javascript">
                        var strStatus='<%#Eval("Status")%>';
                        var orderNum = '<%#Eval("OrderID")%>'
                        if (strStatus == '1') 
                            {
                            document.write("<li class='dingd_9'><em onclick='go_order(" + orderNum + ")'>付款</em><em><em style='cursor:pointer' onclick=delete6order(" + orderNum + ",'未支付')>删除</em></em></li>");
                            }
                            else if (strStatus == '7') {
                                document.write('<li class="dingd_9"><em><a href="MyOrderDetail.aspx?oid=<%#Eval("OrderID") %>" >查看详情</a></em></li>');
                            }
                            </script>
                            </ul>
                        </ItemTemplate>
                
				</asp:TemplateField>
                
                </Columns>
                 <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
        <EmptyDataTemplate>
        <div style='text-align:left;margin-left:20px; width:600px;margin-bottom:10px;'>
		   <p style='color:#FF4E00;font-size:14px;font-weight:bold;'> 您还没有创建订单 ！<br /><br /></p>
		</div>
        </EmptyDataTemplate>
       
        <CustomPagerSettings PagingMode="Webabcd" TextFormat="每页{0}条/共{1}条  第{2}页/共{3}页   " />
        <PagerSettings Position="Bottom" PageButtonCount="13" FirstPageText="首页" PreviousPageText="上一页"
            NextPageText="下一页" LastPageText="末页" />
         <AlternatingRowStyle BackColor="#DCDCDC" />
         <RowStyle BackColor="#EEEEEE" ForeColor="Black" />
                </pan:SmartGridView>
				
			</div>
			<div class="blank25"></div>
			<!--翻页开始-->
		<!--翻页结束-->
		<div class="blank25"></div>
		</div>
		<div class="l_bot"></div>
	<!--左侧部分 结束-->
	 </div> 
  	<uc1:MyAccount ID="MyAccount1" runat="server" />
<DIV class="go-top"><A href="#uptop">↑顶部</A></DIV></div>
<asp:HiddenField   ID="hdUserName" runat="server" />
</asp:Content>

